<?php $this->header(); ?>
<div class="wrap">
    <div class="nav">
        <ul class="cc">
            <li class="current"><a href="/?g=Admin&m=<?php echo MODULE; ?>&a=index">内容列表</a></li>
        </ul>
    </div>
    <div class="h_a">搜索文章</div>
    <div class="search_type cc mb10">
        <form action="/?g=Admin&m=<?php echo MODULE; ?>&a=search" method="POST">
            <input name="clear" type="hidden" value="do" />
            <label>分类：</label>
            <select name="catid" class="mr10" >
                <option value="-1" >不限制</option>
                <?php echo $tree; ?>
            </select>
            <label>文章ID：</label><input name="id" type="number" class="input length_1 mr10" value="<?php echo $id; ?>">
            <label>文章标题包含：</label><input name="title" type="text" class="input length_2 mr10" value="<?php echo $title; ?>">
            <button type="submit" class="btn">搜索</button>
        </form>
    </div>
    <?php if (MODULE != 'Page'): ?>
        <div class="mb10"><a class="btn" href="/?g=Admin&m=<?php echo MODULE; ?>&a=add" title="添加内容" role="button"><span class="add"></span>添加内容</a></div>
    <?php endif; ?>
        <form action="<?php echo $func->url(GROUP.'-'.MODULE.'-listsort'); ?>" method="post">
        <?php if (!empty($list)): ?>
            <div class="table_list">
                <table width="100%">
                    <thead>
                        <tr>
                            <td>排序</td>
                            <td>ID</td>
                            <td>标题</td>
                            <td>发布时间</td>
                            <td>操作</td>
                        </tr>
                    </thead>
                    <?php foreach ($list as $key => $value): ?>
                        <tr>
                            <td><input class="input length_0" type="text" name="listsort[<?php echo $value['id']; ?>]" value="<?php echo $value['listsort']; ?>" /></td>
                            <td><?php echo $value['id']; ?></td>
                            <td>
                                <?php echo empty($value['catid']) ? '' : "<span class='green'>[{$func->getCateName($value['catid'])}]</span>"; ?>
                                <?php echo $value['title']; ?>
                            </td>
                            <td><?php echo $func->toDate($value['createtime'], 'Y-m-d'); ?></td>
                            <td>
                                <a href="<?php echo '/?g=Admin&m=' . MODULE . '&a=edit&id=' . $value['id']; ?>" class="btn btn_submit J_ajax_submit_btn" >编辑</a>
                                <a href="<?php echo '/?g=Admin&m=' . MODULE . '&a=delete&id=' . $value['id']; ?>" class="btn btn_submit J_ajax_submit_btn" onclick="return deleteWarning(this)">删除</a>
                            </td>
                        </tr>
                    <?php endforeach; ?>
                </table>
            </div>
            <?php echo $page; ?>
        <?php else: ?>
            <div class="not_content_mini"><i></i>亲，没内容!</div>
        <?php endif; ?>

        <div class="btn_wrap">
            <div class="btn_wrap_pd">
                <button type="submit" class="btn btn_submit J_ajax_submit_btn">排序</button>
            </div>
        </div>
    </form>
</div>
<?php $this->footer(); ?>